/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author alumno
 */
@Entity
@Table(name = "NOTA_ELIMINADA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "NotaEliminada.findAll", query = "SELECT n FROM NotaEliminada n"),
    @NamedQuery(name = "NotaEliminada.findByAluCod", query = "SELECT n FROM NotaEliminada n WHERE n.notaEliminadaPK.aluCod = :aluCod"),
    @NamedQuery(name = "NotaEliminada.findByModgCod", query = "SELECT n FROM NotaEliminada n WHERE n.notaEliminadaPK.modgCod = :modgCod"),
    @NamedQuery(name = "NotaEliminada.findByNoteFech", query = "SELECT n FROM NotaEliminada n WHERE n.notaEliminadaPK.noteFech = :noteFech"),
    @NamedQuery(name = "NotaEliminada.findByNoteNota", query = "SELECT n FROM NotaEliminada n WHERE n.noteNota = :noteNota")})
public class NotaEliminada implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected NotaEliminadaPK notaEliminadaPK;
    @Column(name = "NOTE_NOTA")
    private Short noteNota;
    @JoinColumns({
        @JoinColumn(name = "ALU_COD", referencedColumnName = "ALU_COD", insertable = false, updatable = false),
        @JoinColumn(name = "MODG_COD", referencedColumnName = "MODG_COD", insertable = false, updatable = false)})
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Inscripcion inscripcion;

    public NotaEliminada() {
    }

    public NotaEliminada(NotaEliminadaPK notaEliminadaPK) {
        this.notaEliminadaPK = notaEliminadaPK;
    }

    public NotaEliminada(int aluCod, String modgCod, Date noteFech) {
        this.notaEliminadaPK = new NotaEliminadaPK(aluCod, modgCod, noteFech);
    }

    public NotaEliminadaPK getNotaEliminadaPK() {
        return notaEliminadaPK;
    }

    public void setNotaEliminadaPK(NotaEliminadaPK notaEliminadaPK) {
        this.notaEliminadaPK = notaEliminadaPK;
    }

    public Short getNoteNota() {
        return noteNota;
    }

    public void setNoteNota(Short noteNota) {
        this.noteNota = noteNota;
    }

    public Inscripcion getInscripcion() {
        return inscripcion;
    }

    public void setInscripcion(Inscripcion inscripcion) {
        this.inscripcion = inscripcion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (notaEliminadaPK != null ? notaEliminadaPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NotaEliminada)) {
            return false;
        }
        NotaEliminada other = (NotaEliminada) object;
        if ((this.notaEliminadaPK == null && other.notaEliminadaPK != null) || (this.notaEliminadaPK != null && !this.notaEliminadaPK.equals(other.notaEliminadaPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.NotaEliminada[ notaEliminadaPK=" + notaEliminadaPK + " ]";
    }
    
}
